]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
background: free MetaBackground explicitly when its MetaBackgroundActor is destroyed
authorHyungwon Hwang <hyungwon.hwang7@gmail.com>
Fri, 10 Jun 2016 10:34:48 +0000 (19:34 +0900)
committerRui Matos <tiagomatos@gmail.com>
Wed, 29 Jun 2016 11:27:10 +0000 (13:27 +0200)
The memory which MetaBackground resides is freed automatically, when its
wrapper object Background is freed by garbage collection. But because the
memory for MetaBackground is huge, changing the background or changing the
background mode repeatedly makes a lot of memory to be in use until garbage
collection runs.

This patch frees the MetaBackground object explicitly when its
MetaBackgroundActor is destroyed which is the moment that the memory in the
object is not used anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=766353

Signed-off-by: Hyungwon Hwang <hyungwon.hwang7@gmail.com>
js/ui/background.js

index 5db1e6c8c87ee342b491020e4254efcb8e3e19b7..762c76c6e7b000381fee9e571152901ca391ff11 100644 (file)
@@ -696,6 +696,7 @@ const BackgroundManager = new Lang.Class({
                            time: FADE_ANIMATION_TIME,
                            transition: 'easeOutQuad',
                            onComplete: function() {
+                               oldBackgroundActor.background.run_dispose();
                                oldBackgroundActor.destroy();
                            }
                          });